#pragma once

#include <cstdint>
#include <set>
#include "SQLiteCpp/SQLiteCpp.h"
#include "User.h"

class DbDataManager
{
  public:
    DbDataManager();
    ~DbDataManager();

    user_id_t addUser(const User& user);
    bool      getUser(const user_id_t id, User& user);
    bool      updateUser(const User& user);
    bool      updateFriendShip(const User& user, const User& otherUser);
    bool      addNewFriend(user_id_t userId, user_id_t otherUserId);
    bool      deleteFriend(user_id_t userId, user_id_t otherUserId);

    bool                                deleteUser(const user_id_t id);
    std::set<std::string>               getAllUserNames();
    std::unordered_map<user_id_t, User> getAllUsers();

  private:
    bool updateOneUserFriendship(const User& user);

  private:
    SQLite::Database user_db_;
};